<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="/struts-dojo-tags" prefix="sx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	java.util.Date currTime = new java.util.Date();
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	String strTime = sdf.format(currTime);
%>

<html>
	<head>
		<title>消费页面</title>
		<script type="text/javascript"> 
			function IsNum(obj){
			var val = obj.value;
			var one = val.substr(0,1);
			obj.value = (parseInt(val) || '');
			//obj.value = one != '0'? (parseInt(val) || '') : one + (parseInt(val.substr(1,val.length)) || '');
			}
		</script>
		
		<link rel="stylesheet" type="text/css" href='<s:url value="/styles.css" />'>
		<sx:head/>
	</head>
	<body>
		<s:include value="header.jsp" />
		<s:if test="#session['user'] != null">
			<div class="divNavigatorOuterFrame">
				<div class="divNavigatorInnerFrame" style="text-align: right;">
					欢迎<s:property value="#session['user'].name" />&nbsp;&nbsp;
				</div>
			</div>
			<div class="divWhiteLine"></div>
		</s:if>
		<s:form action="DaycostAction_newDaycost.action" theme="simple" method="post">
		<table>
			<tr>
				<td colspan="2" class="tdHeader"><s:if test="status == null">添加</s:if ><s:else><s:label name="status"/></s:else>消费</td>
				<s:hidden name="status"/>
				<s:hidden name="daycost.id"/>
			</tr>
			<tr>
				<td class="tdFormLabel">消费时间:</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.costtime" cssClass="text"/>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">早餐(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.breakfast" cssClass="text" onkeyup="javascript:IsNum(this)" />
					<font class="fonterror"><s:fielderror><s:param>breakfast</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">午餐(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.lunch" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>lunch</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">晚餐(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.dinner" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>dinner</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">宵夜(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.supper" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>supper</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">看病(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.ill" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>ill</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">学习用品(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.schoolsupplies" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>schoolsupplies</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">生活用品(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.articleuse" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>articleuse</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">公汽(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.bus" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>bus</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">的士费(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.texi" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>texi</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">长途汽车费(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.coach" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>coach</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">火车费(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.train" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>train</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">订票费(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.booking" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>booking</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">船票费(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.ship" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>ship</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">机票费(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.airplane" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>airplane</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">住宿费(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.hotel" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>hotel</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">礼品费(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.gift" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>gift</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">房租(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.rent" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>rent</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">水电费(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.waterelectricity" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>waterelectricity</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">宽带费(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.broadband" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>broadband</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">电话费(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.phone" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>phone</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">还贷款/还钱(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.payback" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>payback</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">其它费用(元):</td>
				<td class="tdFormControl">
					<s:textfield name="daycost.others" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>others</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">备注:</td>
				<td class="tdFormControl">
					<s:textarea colspan="1" name="daycost.comments" cssClass="text" />
					<font class="fonterror"><s:fielderror><s:param>comments</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td colspan="2"></td>
			</tr>
			</table>
			<table align="right">
			<tr>				
				<td><s:submit cssClass="btn" value="确定"/></td>
			</tr>
		</table>
		</s:form>
	</body>
</html>